package com.ymatou.iapi.productmanager.testcase;

import java.util.Arrays;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.productmanager.parameter.GetUnLinkedSpuCatalogsBean;
import com.ymatou.iapi.productmanager.service.GetUnLinkedSpuCatalogsCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.utils.EnvSetup;
/**
*查询可关联的标品规格
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetUnLinkedSpuCatalogs{
	private static GetUnLinkedSpuCatalogsBean getunlinkedspucatalogsBean;
	private static GetUnLinkedSpuCatalogsCall getunlinkedspucatalogsCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询商家所有功能状态Test");
	}

	@Before
	public void caseUp() {
		getunlinkedspucatalogsBean=new GetUnLinkedSpuCatalogsBean();
		getunlinkedspucatalogsCall=new GetUnLinkedSpuCatalogsCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getunlinkedspucatalogsCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	private static Integer sellerId = Integer.valueOf(EnvSetup.getData("productsellerid"));
	private static String sellerName = EnvSetup.getData("productsellername");
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetUnLinkedSpuCatalogs_001() {
		Logger.start(true,"正确数据，成功");
		try {
			
			getunlinkedspucatalogsBean.setSellerId(sellerId);
			getunlinkedspucatalogsBean.setSpuProductIds(Arrays.asList(229));
			getunlinkedspucatalogsCall.setData(getunlinkedspucatalogsBean);
			getunlinkedspucatalogsCall.callService();			
			Logger.verifyEquals("200", getunlinkedspucatalogsCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}